Device power management method and apparatus

ABSTRACT

A power management method and associated apparatus allows a device to make maximum use of its battery before replacement or recharging. After a battery failure, the device may be shut down properly and disabled until the battery is replaced or recharged. An exemplary embodiment is described in the context of a digital camera.

FIELD OF THE INVENTION

[0001] The present invention relates generally to electronic devices andmore specifically to battery-powered electronic devices with datastorage capabilities.

BACKGROUND OF THE INVENTION

[0002] One problem that arises with battery-powered devices is thesudden loss of power due to battery failure. This problem is especiallyserious in a portable device that stores data such as a digital camera,hand-held computer, or cellular phone because the file system can becomecorrupted due to the unexpected loss of power.

[0003] One way to deal with the problem is to disable operation of thedevice when the battery charge drops to a predetermined percentage ofits capacity. For example, the device may warn the user to ceaseoperation, or the device may prevent further operation, when the batterydrops to 20 percent of its capacity. Although this approach preventssudden, catastrophic power loss, it wastes significant battery capacityand shortens the time between recharges. Moreover, some battery typessuch as nickel cadmium batteries eventually lose capacity if they arenot substantially depleted before being recharged. Therefore, the methodof holding battery charge in reserve can shorten the usable life of suchbatteries.

[0004] A more sophisticated approach involves predicting the remaininglife of specific batteries or battery types. This approach takesadvantage of differences in quality among batteries by allowing thedevice to operate longer without recharging when a high-quality batteryis present. This approach increases development costs because extensivetesting and profiling of the wide variety of available batteries isrequired. Also, the device's software or firmware must be configured toimplement multiple power management profiles, increasing complexity.

[0005] It is thus apparent that there is a need in the art for animproved power management method for battery-operated devices.

SUMMARY OF THE INVENTION

[0006] A method is provided for starting up a battery-powered deviceafter a battery failure. An apparatus is also provided to carry out themethod.

[0007] Other aspects and advantages of the present invention will becomeapparent from the following detailed description, taken in conjunctionwith the accompanying drawings, illustrating by way of example theprinciples of the invention.

BRIEF DESCRIPTION OF THE DRAWINGS

[0008]FIGS. 1A and 1B are flowcharts showing exemplary prior-art methodsfor providing a robust file system used by the invention.

[0009]FIG. 2 is a block diagram of a digital camera in accordance withan exemplary embodiment of the invention.

[0010]FIG. 3 is a block diagram of a method for shutting down thedigital camera shown in FIG. 2 in accordance with an exemplaryembodiment of the invention.

[0011] FIGS. 4A-4C are flowcharts of a method for starting up thedigital camera shown in FIG. 2 in accordance with an exemplaryembodiment of the invention.

DETAILED DESCRIPTION OF THE INVENTION

[0012] Useable battery life in a battery-operated device may be extendedby allowing a device to operate until a battery failure occurs.Throughout this detailed description, a “battery failure” denotes acondition in which the battery charge drops below the level required tooperate the device. Since most batteries, once the load has beenremoved, recover sufficiently after a few moments to allow briefoperation of the device, that brief period may be used to shut down thedevice properly until the battery has been replaced or recharged. Oncethe battery has been replaced or recharged, the device may take steps tocorrect any anomalies in its stored data that may have been caused bythe sudden loss of power. For example, the device may ensure theintegrity of its file system, in particular its file allocation table(FAT), by deleting any incomplete FAT entries that were not properlywritten during the battery failure.

[0013] The approach just described assumes an underlying robust filesystem that is designed to prevent the loss of more than one data object(e.g., the most recently created data object) due to an unexpected lossof power. Although such robust file systems are well known in the art,two simple examples are provided in FIGS. 1A and 1B. Both examplesinclude a FAT, although not all file systems use a FAT, as those skilledin the art will recognize. In either case, the file system includes amethod for keeping track of files and where they are located. In FIG.1A, a need to update the FAT at 105 causes the FAT to be copied fromnon-volatile storage such as flash memory to random access memory (RAM)at 110. The update is made to the copy at 115. If power is suddenly lostdue to a battery failure, the original FAT is still stored innon-volatile memory, and only the newest entry in the copy is lost.Under normal conditions, the updated FAT created from the copy is savedto non-volatile memory at 120, and the original FAT is deleted fromnon-volatile memory at 125. In FIG. 1B, a new entry is appended to theFAT in non-volatile memory at 125, eliminating the need to copy andrewrite the entire FAT each time an update is made. Periodically, whensuitable criteria are satisfied at 130 (e.g., when the battery is wellcharged and the device is turned on but idle), the FAT is rewritten toeliminate out-of-date entries at 135. The methods shown in FIGS. 1A and1B are merely examples. Any file system robust against unexpected powerloss, including those not employing a FAT, may be used in implementingthe invention.

[0014] The invention may be applied to a wide variety ofbattery-operated devices such as digital cameras, hand-held computers,personal digital assistants (PDAs), electronic organizers, or cellularphones. FIG. 2 is a block diagram of a digital camera 200 in accordancewith an exemplary embodiment of the invention. In FIG. 2, controller 205communicates over data bus 210 with imaging device 215, internal memory220, battery status circuit 223, power button 225, display 230, andnonvolatile memory 235. Imaging device 215 converts optical imagesreceived from optical system 240 to digital images. In a typicalimplementation, imaging device 215 comprises a charge-coupled device(CCD), an analog-to-digital converter (A/D), a gain control, and adigital signal processor (DSP) (not shown in FIG. 2). Internal memory220 may comprise both RAM and non-volatile memory such as flash memory.The RAM is used to hold digital images temporarily until they can betransferred to non-volatile storage. A shutdown bit 245 and a disablebit 250, which will be explained in a later portion of this description,may be stored in the nonvolatile portion of internal memory 220.Non-volatile memory 235, which is typically of the removable type, isused for long-term storage of digital images produced by imaging device215. Non-volatile memory 235 includes a file system 255, of which onekey component is FAT 260. Digital camera 200 may be powered by a battery265. When digital camera 200 is off, power may be removed from allcomponents except controller 205 so that controller 205 can detectchanges in state of power button 225.

[0015] Controller 205, via battery status circuit 223, may determine thecharge status of battery 265. For example, battery status circuit 223may measure the voltage of battery 265. Alternatively, battery statuscircuit 223 may comprise an electromechanical mechanism that detects theremoval and insertion of battery 265. Techniques for measuring batteryvoltage and detecting battery insertion and removal are well known inthe art. Throughout this detailed description, the charge status ofbattery 265 will be considered “favorable” whenever battery 265 iscapable of powering digital camera 200 for a period longer than a briefshutdown sequence performed whenever digital camera 200 is powered off.Otherwise, the charge status of battery 265 will be considered“unfavorable.”

[0016] In an exemplary embodiment of the invention, shutdown bit 245 isused to determine whether digital camera 200 was shut down properly.Shutdown bit 245 is nominally cleared (logic “0”) when digital camera200 is off. When digital camera 200 is turned on, shutdown bit 245 isset (logic “1”) to correspond to the power-on state. When digital camerais shut down normally, shutdown bit 245 is cleared. The normal shutdownprocedure is summarized in the flowchart of FIG. 3. If a request to turnoff digital camera 200 is received at 305, a shutdown sequence isperformed at 310. The shutdown sequence may comprise such tasks asremoving power from all components of digital camera 200 exceptcontroller 205, placing control lines in a high-impedance state,removing charge from a strobe (flash unit), and retracting a lensincluded in optical system 240. Controller 205 remains powered to sensesubsequent input from power button 225 after digital camera 300 has beenturned off. At 315, shutdown bit 245 is cleared to indicate a normalshutdown, and the process ends at 320.

[0017] If during operation of digital camera 200 power is suddenly lostdue to a battery failure, the normal shutdown sequence is not performed,and shutdown bit 245 is not cleared. The next time digital camera 200 isstarted up, controller 205 can detect that digital camera 200 was notshut down properly, indicating the possibility of a battery failure.Disable bit 250 may be used to indicate that a battery failure hasoccurred and that further operation of digital camera 200 should bedisabled until battery 265 is recharged or replaced. For example, ifshutdown bit 245 is found to be set upon start up, indicating a possiblebattery failure, the status of battery 265 may be determined via batterystatus circuit 223 as explained previously. If the status of battery 265is unfavorable, the residual charge on battery 265 may be used toperform the shutdown sequence and to set disable bit 250, indicatingthat further operation of the device is to be prevented until battery265 is recharged or replaced. Further attempts to start up digitalcamera 200 will fail until battery 265 is recharged or replaced, atwhich time digital camera 200 may be started up normally, disable bit250 cleared, and the integrity of file system 255 checked.

[0018] FIGS. 4A-4C are flowcharts of a method for starting up digitalcamera 200 in accordance with an exemplary embodiment of the invention.The method shown in FIGS. 4A-4C may be performed whenever digital camera200 is off and power button 225 is pressed to activate the device. Ifpower button 225 is pressed at 405, the status of shutdown bit 245 ispolled at 410. If shutdown bit 245 is cleared (logic “0”), the status ofdisable bit 250 is polled at 415. If disable bit 250 is also cleared(logic “0”), digital camera 200 is started up normally at 420. Shutdownbit 245 is then set (logic “1”) at 425, and the start-up processterminates at 430. If shutdown bit 245 is set (logic “1”) at 410,controller 205 can determine that digital camera was not shut downproperly, possibly due to a battery failure. In that case, controlproceeds to FIG. 4B.

[0019] In FIG. 4B, the status of battery 265 is obtained from batterystatus circuit 223 at 435. If the status is favorable at 440 (e.g.,battery 265 has been recharged or replaced since the battery failure),digital camera is started up at 420. If the status of battery 265 isunfavorable at 440, the shutdown sequence is performed at 310. Followingthe shutdown sequence, shutdown bit 245 is cleared and disable bit 250is set at 450, after which the process terminates at 430. Disable bit250 is set at 450 to indicate that digital camera 200 may not beoperated again until battery 265 is either replaced or recharged. If thestatus of battery 265 was favorable at 440 and digital camera 200started up successfully at 420, file system 255 may have been corruptedby the failure of battery 265. In this particular exemplary embodiment,it is assumed that new FAT entries are appended as explained inconnection with FIG. 1B. At 455, controller 205 checks for an incompleteFAT entry. If one is found, it may be deleted at 460, and an errormessage may be output to display 230 at 465 to warn a user that the lastimage captured has been lost. In other embodiments, the FAT may becopied before being modified as in FIG. 1A. In that case, anincompletely saved FAT may have to be deleted, not just a single entry.In either case, however, at most one FAT entry (the most recent one) islost.

[0020] If shutdown bit 245 is cleared (logic “0”) at 410 in FIG. 4A anddisable bit 250 is set (logic “1”) at 415, control proceeds to 435 inFIG. 4C, where the status of battery 265 is determined from batterystatus circuit 223. In this case, the steps shown in FIG. 4B havealready been performed. That is, a battery failure has occurred, anddigital camera has been shut down using the residual power of battery265. Any further attempt to turn on digital camera 200 leads to 435 inFIG. 4C. If the battery status is unfavorable at 440 in FIG. 4C, theprocess ends at 430 without digital camera 200 being started up becausedisable bit 250 is set. If the status of battery 265 is favorable at440, digital camera 200 is started up at 420, after which shutdown bit245 is set and disable bit 250 is cleared at 470. Processing thenproceeds as indicated in FIG. 4B (steps 455, 460, and 465).

[0021] The foregoing description of the present invention has beenpresented for the purposes of illustration and description. It is notintended to be exhaustive or to limit the invention to the precise formdisclosed, and other modifications and variations may be possible inlight of the above teachings. The embodiments were chosen and describedin order to best explain the principles of the invention and itspractical application to thereby enable others skilled in the art tobest utilize the invention in various embodiments and variousmodifications as are suited to the particular use contemplated. It isintended that the appended claims be construed to include otheralternative embodiments of the invention except insofar as limited bythe prior art.

What is claimed is:
 1. A method for starting up a battery-powered deviceafter a battery failure, comprising: ascertaining a status of thebattery; disabling further operation of the device, when the status ofthe battery is unfavorable; and ensuring the integrity of a file systemin the device and starting up the device, when the status of the batteryis favorable.
 2. The method of claim 1, further comprising: performing ashutdown sequence prior to disabling further operation of the device,when the status of the battery is unfavorable.
 3. The method of claim 1,wherein ascertaining a status of the battery comprises measuring thevoltage of the battery.
 4. The method of claim 1, wherein ascertaining astatus of the battery comprises detecting whether a battery has beeninserted into the device.
 5. The method of claim 1, wherein the devicecomprises a digital camera.
 6. The method of claim 5, wherein theshutdown sequence comprises retracting a lens of the digital camera. 7.The method of claim 1, wherein disabling further operation of the devicecomprises setting a disable bit.
 8. The method of claim 1, whereinensuring the integrity of a file system in the device comprises:detecting an incomplete file-allocation-table entry; deleting theincomplete file-allocation-table entry; and outputting an error message.9. The method of claim 8, wherein the error message comprises a warningthat a most recently created data object in the device has been lost.10. The method of claim 9, wherein the data object comprises a digitalimage.
 11. The method of claim 1, wherein starting up the devicecomprises setting a shutdown bit.
 12. The method of claim 1, whereinstarting up the device comprises clearing a disable bit.
 13. A methodfor managing the operation of a battery-powered device in response to apower-on request, the device including a shutdown bit and a disable bit,the method comprising the steps of: (a) testing the shutdown and disablebits; (b) starting up the device and setting the shutdown bit, when theshutdown and disable bits are both cleared; (c) performing the followingsteps (i)-(iii), when the shutdown bit is set and the disable bit iscleared; (i) ascertaining a status of the battery; (ii) performing ashutdown sequence, clearing the shutdown bit, and setting the disablebit, when the status of the battery is unfavorable; (iii) starting upthe device and ensuring the integrity of a file system in the device,when the status of the battery is favorable; and (d) performing thefollowing steps (i)-(iii), when the shutdown bit is cleared and thedisable bit is set; (i) ascertaining a status of the battery; (ii)starting up the device, ensuring file system integrity, clearing thedisable bit, and setting the shutdown bit, when the status of thebattery is favorable; (iii) preventing operation of the device, when thestatus of the battery is unfavorable.
 14. The method of claim 13,wherein ascertaining a status of the battery comprises measuring thevoltage of the battery.
 15. The method of claim 13, wherein ascertaininga status of the battery comprises determining whether a battery has beeninserted into the device.
 16. The method of claim 13, wherein the devicecomprises a digital camera.
 17. The method of claim 16, wherein theshutdown sequence comprises retracting a lens of the digital camera. 18.The method of claim 13, wherein ensuring the integrity of a file systemin the device in steps (c)(iii) and (d)(ii) comprises: detecting anincomplete file-allocation-table entry; deleting the incompletefile-allocation-table entry; and outputting an error message.
 19. Themethod of claim 18, wherein the error message comprises a warning that amost recently created data object in the device has been lost.
 20. Themethod of claim 19, wherein the data object comprises a digital image.21. A device, comprising: a battery; a circuit to determine a status ofthe battery; a file system; and control logic configured to perform ashutdown sequence and prevent further operation of the device, when thestatus of the battery is unfavorable, and to ensure the integrity of thefile system and start up the device, when the status of the battery isfavorable.
 22. The device of claim 21, wherein the circuit to determinea status of the battery is configured to measure the voltage of thebattery.
 23. The device of claim 21, wherein the circuit to determine astatus of the battery is configured to detect the insertion of abattery.
 24. The device of claim 21, wherein the device comprises adigital camera.
 25. The device of claim 24, wherein the control logic isconfigured to retract a lens of the digital camera during the shutdownsequence.
 26. The device of claim 21, wherein the file system comprisesa file allocation table having at least one entry, the file system beingconfigured to allow the loss of at most one entry when the batteryfails.
 27. The device of claim 26, wherein the control logic isconfigured to detect an incomplete entry, delete the incomplete entry,and output an error message.
 28. The device of claim 27, wherein theerror message comprises a warning that a most recently created dataobject in the device has been lost.
 29. The device of claim 28, whereinthe data object comprises a digital image.
 30. The device of claim 21,wherein the control logic comprises a shutdown bit to detect when thedevice has experienced a battery failure.
 31. The device of claim 21,wherein the control logic comprises a disable bit to prevent the devicefrom being operated when the status of the battery is unfavorable.
 32. Adevice, comprising: means for providing power; means for determining astatus of the means for providing power; means for managing files; andmeans for performing a shutdown sequence and preventing furtheroperation of the device, when the status of the means for providingpower is unfavorable, and for ensuring the integrity of the means formanaging files and starting up the device, when the status of the meansfor providing power is favorable.
 33. The device of claim 32, whereinthe means for providing power comprises a battery.
 34. The device ofclaim 33, wherein the means for determining a status of the means forproviding power is configured to measure the voltage of the battery. 35.The device of claim 33, wherein the means for determining a status ofthe means for providing power is configured to detect the insertion of abattery.
 36. The device of claim 32, wherein the device comprises adigital camera.
 37. The device of claim 36, further comprising: meansfor retracting a lens of the digital camera during the shutdownsequence.
 38. The device of claim 32, wherein the means for managingfiles comprises a file allocation table having at least one entry, themeans for managing files being configured to allow the loss of at mostone entry when the means for providing power fails.
 39. The device ofclaim 38, further comprising: means for detecting an incomplete entry,deleting the incomplete entry, and outputting an error message.
 40. Thedevice of claim 39, wherein the error message comprises a warning that amost recently created data object in the device has been lost.
 41. Thedevice of claim 40, wherein the data object comprises a digital image.42. The device of claim 32, wherein the means for performing a shutdownsequence and preventing further operation of the device, when the statusof the means for providing power is unfavorable, and for ensuring theintegrity of the means for managing files and starting up the device,when the status of the means for providing power is favorable, comprisesa shutdown bit to detect when the device has experienced a failure ofthe means for providing power.
 43. The device of claim 32, wherein themeans for performing a shutdown sequence and preventing furtheroperation of the device, when the status of the means for providingpower is unfavorable, and for ensuring the integrity of the means formanaging files and starting up the device, when the status of the meansfor providing power is favorable, comprises a disable bit to prevent thedevice from being operated when the status of the means for providingpower is unfavorable.